home *** CD-ROM | disk | FTP | other *** search
- {****************************************************}
- { CBitMapPane.p}
- {}
- { The BitMapPane Class}
- {}
- { SUPERCLASS = CPanorama}
- {}
- { Copyright ⌐ 1989, Symantec Corporation. All rights reserved. }
- {}
- {****************************************************}
-
- unit CBitMapPane;
-
- interface
-
- uses
- TCL, MoreTCL;
-
-
- implementation
-
-
-
- {*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
-
-
-
- {****************************************************}
- { IBitMapPane}
- {}
- { Initialize a BitMapPane object}
- {}
- {****************************************************}
-
- procedure CBitMapPane.IBitMapPane (anEnclosure: CView; aSupervisor: CBureaucrat; aWidth, aHeight, aHEncl, aVEncl: integer; aHSizing, aVSizing: SizingOption; aBounds: Rect; aBitMap: CBitMap; makePort: Boolean);
- var
- theBitMap: CBitMap; { Altered by TCL Weaver 1.0 (5/9/90) }
-
- begin
- IPanorama(anEnclosure, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
-
- bounds := aBounds;
- position.h := bounds.left;
- position.v := bounds.top;
-
- if aBitMap = nil then
- begin
- new(theBitMap); { Altered by TCL Weaver 1.0 (5/9/90) }
- itsBitMap := theBitMap;
- itsBitMap.IBitMap(aBounds.right - aBounds.left, aBounds.bottom - aBounds.top, makePort);
-
- {Exit if we couldn't create the bitmap. }
- {Someone further up the call chain (i.e., }
- {CArtClassDoc.BuildWindow) should }
- {detect the problem and tell gError to post an alert. }
-
- if itsBitMap.macBitMap.baseAddr = nil then
- Exit(IBitMapPane);
-
- itsBitMap.SetBoundsOrigin(aBounds.left, aBounds.top);
- end
- else
- itsBitMap := aBitMap;
-
- autoRefresh := FALSE;
- end;
-
-
- {****************************************************}
- { Free (OVERRIDE)}
- {}
- { Dispose of a BitMapPane}
- {}
- {****************************************************}
-
- procedure CBitMapPane.Free;
- begin
- if itsBitMap <> nil then
- itsBitMap.Free;
-
- inherited Free;
- end;
-
-
-
- {*** A C C E S S I N G M E T H O D S ***}
-
-
-
- {****************************************************}
- { SetBitMap}
- {}
- { Specify the BitMap associated with a BitMapPane}
- {}
- {****************************************************}
-
- procedure CBitMapPane.SetBitMap (aBitMap: CBitMap);
- begin
- itsBitMap := aBitMap; { Set instance variable }
- end;
-
-
- {****************************************************}
- { GetBitMap}
- {}
- { Return a reference to the BitMap associated with a BitMapPane}
- {}
- {****************************************************}
-
- function CBitMapPane.GetBitMap: CBitMap;
- begin
- GetBitMap := itsBitMap;
- end;
-
-
-
- {*** D R A W I N G M E T H O D S ***}
-
-
-
- {****************************************************}
- { Draw (OVERRIDE)}
- {}
- { Draw a BitMapPane}
- {}
- {****************************************************}
-
- procedure CBitMapPane.Draw (var area: Rect);
- var
- temp: Boolean;
-
- begin
- if itsBitMap <> nil then
- begin
- temp := SectRect(area, itsBitMap.macBitMap.bounds, area);
-
- itsBitMap.CopyFrom(area, area, nil);
- end;
- end;
-
-
- end.